# $Id: PKGBUILD 163135 2012-07-08 02:03:57Z bisson $
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=tinycdb
pkgver=0.78
pkgrel=1
pkgdesc='Very fast and simple package for creating and reading constant data bases'
url='http://www.corpit.ru/mjt/tinycdb.html'
license=('custom')
arch=('i686' 'x86_64')
source=("http://www.corpit.ru/mjt/tinycdb/${pkgname}-${pkgver}.tar.gz")
sha1sums=('ade42ee1e7c56f66a63cb933206c089b9983adba')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	sed -e 's/all: static/all: shared/' -e '/libcdb.a/d' -i Makefile
	make CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" prefix=/usr mandir=/usr/share/man \
		INSTALLPROG=cdb-shared install-{all,sharedlib}
	install -Dm644 debian/copyright "${pkgdir}"/usr/share/licenses/tinycdb/copyright
}
